## 首次创建并运行redis容器
if [ "$1" = "create" ]; then
        for port in $(seq 6580 6585);
        do
              docker run -di --restart always --name redis-${port} --net jkTimeredis -p ${port}:${port} -p 1${port}:1${port} -v /home/docker_data/redis-cluster/node-${port}/conf/redis.conf:/usr/local/etc/redis/redis.conf -v /home/docker_data/redis-cluster/node-${port}/data:/data redis redis-server /usr/local/etc/redis/redis.conf
        done
fi
##停止redis容器
if [ "$1" = "stop" ]; then
        for port in $(seq 6580 6585);
        do
                docker stop redis-${port}
        done
fi
​
##启动已有的redis容器
if [ "$1" = "start" ]; then
        for port in $(seq 6580 6585);
        do
                docker start redis-${port}
        done
fi
​
## 删除redis容器
if [ "$1" = "rm" ]; then
        for port in $(seq 6580 6585);
        do
                docker rm redis-${port}
        done
fi